<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.tjsinfo.tjsoa.workplan.vo.WorkPlanDefine"%>
<%@page import="com.tjsinfo.tjsoa.workplan.vo.WorkPlanExamine"%>
<%@page import="com.tjsinfo.tjsoa.common.PageController"%>
<%@page import="com.tjsinfo.tjsoa.workplan.vo.WorkPlanMain"%>
<%@page import="com.tjsinfo.tjsoa.common.ToolKit"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <base href="<%=basePath%>"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>粮油集团办公自动化协作平台</title>
<link href="style/txlz7.css" rel="stylesheet" type="text/css" />
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript">
		function page2()
		{
			document.from1.submit();
			
		}
	</script>
  </head>
  
  <body>
  	 <div id="right" >
      <div class="p_011">
         <table width="100%" border="0" cellspacing="0" cellpadding="0" >
                          <tr>
                            <td width="90%" style="padding-top:4px;"><img src="images/spgzjh.gif" /></td>
                            <td width="10%" style="padding-top:4px;" valign="middle"><a href="<%=basePath %>tjsinfo/tjsoa/workplan/checkDefalntWorkPlan.do"><img src="images/cgsp.gif" /></a></td>
                          </tr>
         </table>
	  </div>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" height="92%" >
          <tr>
            <td width="99%" valign="top" height="100%">
               <div class="contabyear" style="overflow: scroll;">
                  <table class="p_06" width="100%" border="0" cellspacing="0">
                        <tr>
                        <th width="20%">日期</th>
                        <th width="10%">状态</th>
                        <th width="10%">类型</th>
                        <th width="20%">上报人</th>
                        <th width="40%">操作</th>
                        
                      </tr>
                       <%
    	
    	List list = (List)request.getAttribute("list");
    	Iterator iterator = list.iterator();
    	while(iterator.hasNext())
    	{
    		WorkPlanExamine workPlanDefine = (WorkPlanExamine)iterator.next();
    		WorkPlanMain workPlanMain = workPlanDefine.getWorkPlanMain();
    %>
    <tr>
    	<td><%
                        if("D".equals(  workPlanMain.getType()))
                        {
                        	out.print(ToolKit.getFormatDate(workPlanMain.getTime(),"yyyy-MM-dd") );
                        	
                        }
                        else if("Y".equals(workPlanMain.getType()))
                        {
                        	out.print(workPlanMain.getNumber()+"年");
                        }
                        else if("W".equals(workPlanMain.getType()))
                        {
                        	out.print(workPlanMain.getYear()+"年" + workPlanMain.getNumber()+"周" );	
                        }
                        else if("M".equals(workPlanMain.getType()))
                        {
                        	out.print(workPlanMain.getYear()+"年" + workPlanMain.getNumber()+"月" );
                        }
                        else if("Q".equals(workPlanMain.getType()))
                        {
                        	out.print(workPlanMain.getYear()+"年" + workPlanMain.getNumber()+"季度" );
                        }
                        else if("H".equals(workPlanMain.getType()))
                        {
                        	if(workPlanMain.getNumber() == 1)
                        	{
                        		out.print(workPlanMain.getYear()+"年" + "上半年" );
                        	}
                        	else 
                        	{
                        		out.print(workPlanMain.getYear()+"年" + "下半年" );
                        	}
                        }
                        %></td>
                        <td>
                        	<%
                        		if(workPlanDefine.getWorkPlanMain().getStart() == 1)
                        		{
                        			out.print("已制定");
                        		}
                        		else if(workPlanDefine.getWorkPlanMain().getStart() == 2)
                        		{
                        			out.print("已查阅");
                        		}
                        		else 
                        		{
                        			out.print("已完成");
                        		}
                        	%>
                        </td>
                        <td>
                        	<%
                        		if("D".equals(workPlanDefine.getWorkPlanMain().getType()) )
                        		{
                        			out.print("日计划");
                        		}
                        		else if("W".equals(workPlanDefine.getWorkPlanMain().getType()) )
                        		{
                        			out.print("周计划");
                        		}
                        		else if("M".equals(workPlanDefine.getWorkPlanMain().getType()) )
                        		{
                        			out.print("月计划");
                        		}
                        		else if("Q".equals(workPlanDefine.getWorkPlanMain().getType()) )
                        		{
                        			out.print("季度计划");
                        		}
                        		else if("H".equals(workPlanDefine.getWorkPlanMain().getType()) )
                        		{
                        			out.print("半年计划");
                        		}
                        		else if("Y".equals(workPlanDefine.getWorkPlanMain().getType()) )
                        		{
                        			out.print("年计划");
                        		}
                        	%>
                        </td>
                        <td>
                        	<%=workPlanDefine.getWorkPlanMain().getTjsUser().getUserName() %>
                        </td>
                        <td>
                        	<%
                        		if(workPlanDefine.getWorkPlanMain().getStart() == 1)
                    		{
                    		%>
                    		  <a href="<%=basePath%>tjsinfo/tjsoa/workplan/InstructionWorkPlanFrom.do?id=<%=workPlanDefine.getWorkPlanMain().getId() %>">批示</a> | <a href="<%=basePath%>tjsinfo/tjsoa/workplan/selectWorkPlan.do?id=<%=workPlanDefine.getWorkPlanMain().getId() %>">查看</a>	
                    		<% 	
                    		}
                    		else if(workPlanDefine.getWorkPlanMain().getStart() == 2)
                    		{
                    		%>
                    		<a href="<%=basePath%>tjsinfo/tjsoa/workplan/InstructionWorkPlanFrom.do?id=<%=workPlanDefine.getWorkPlanMain().getId() %>">批示</a> |<a href="<%=basePath%>tjsinfo/tjsoa/workplan/selectWorkPlan.do?id=<%=workPlanDefine.getWorkPlanMain().getId() %>">查看</a>
                    		<% 	
                    		}
                    		else 
                    		{
                    		%>
                    		<a href="<%=basePath%>tjsinfo/tjsoa/workplan/selectWorkPlan.do?id=<%=workPlanDefine.getWorkPlanMain().getId() %>">查看</a> | <a href="<%=basePath%>tjsinfo/tjsoa/workplan/InstructionWorkPlanFrom.do?id=<%=workPlanDefine.getWorkPlanMain().getId() %>">批示</a>
                    		<% 	
                    		}
                        	%>         
                        	
                       </td>
                       </tr>
                      
    <%
    	}
    %>
                      <tr align="center">
                        <td colspan="7">
                          <div class="page" style="height: 50px">
           <%PageController pageController = (PageController)request.getAttribute("pageController");
   		Integer  totalpage =	pageController.getPageCount();
   		out.print("共"+totalpage + "页,"); 
   		out.print("当前为第"+pageController.getCurrentPageNum() + "页,");
   		if(pageController.getCurrentPageNum() != 1 && list.size() >0)
   		{
   			int page2 = pageController.getCurrentPageNum(); 
   		%>
   			<a href="<%=basePath%>tjsinfo/tjsoa/workplan/checkSuddenlyWorkPlan.do?start=up&page=<%=page2%>">上一页</a>
   		<% 
   		}	
   		
		if(pageController.getCurrentPageNum() != pageController.getPageCount() && list.size() > 0)
   		{
   			int page2 = pageController.getCurrentPageNum(); 
   		%>
   			<a href="<%=basePath%>tjsinfo/tjsoa/workplan/checkSuddenlyWorkPlan.do?start=down&page=<%=page2%>">下一页</a>
   		<% 
   		}
   		
   		%><form name="from1" action="<%=basePath%>tjsinfo/tjsoa/workplan/checkSuddenlyWorkPlan.do" method="post">
   			跳转到<select name="page" onchange="page2()">
   				<%
   					int total = pageController.getPageCount();
   					for(int a =1;a<=total;a++)
   					{
   						if(a == pageController.getCurrentPageNum())
   						{
   				%>
   					<option value="<%=a%>" selected="selected"><%=a%>
   				<% 		
   						}
   						else 
   						{
   				%>
   					<option value="<%=a%>"><%=a%>   				
   				<% 		
   						}
   					}
   		
   				%>
   				
   			</select>页
   		</form>                   
                          
                          
                 </div>
                        </td>
                    </tr>
                 </table>
              </div>
            </td>
          </tr>
      </table>
</div>
  
  
  
  
  </body>
</html>
